clear all 
set more off


* To replicate Tables 1 and 2 use data file named "Tables_data.dta":
use "Tables_data.dta"
* Note that the code will replicate each country's model. where the first line of code is for Table 1 
* and the second line of code is for Table 2. The output here will be ordered by CHES's party ID.
* In the article I ordered the parties by their groups.    

* Belguim F:
clogit cvote dis_lr ib107.party_id if country==0, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib107.party_id if country==0, group(respid) or

* Belguim W:
clogit cvote dis_lr ib106.party_id if country==1, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib106.party_id if country==1, group(respid) or

* Denmark
clogit cvote dis_lr ib107.party_id if country==0, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib202.party_id if country==2, group(respid) or

* Germany
clogit cvote dis_lr ib303.party_id if country==3, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib303.party_id if country==3, group(respid) or

* Spain
clogit cvote dis_lr ib505.party_id if country==5, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib505.party_id if country==5, group(respid) or

* France
clogit cvote dis_lr ib613.party_id if country==6, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib613.party_id if country==6, group(respid) or

*Netherlands
clogit cvote dis_lr ib1004.party_id if country==10, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib1004.party_id if country==10, group(respid) or

*UK
clogit cvote dis_lr ib1104.party_id if country==11, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib1104.party_id if country==11, group(respid) or

* Austria
clogit cvote dis_lr ib1309.party_id if country==13, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib1309.party_id if country==13, group(respid) or

* Finland
clogit cvote dis_lr ib1403.party_id if country==14, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib1403.party_id if country==14, group(respid) or

* Sweden
clogit cvote dis_lr ib1604.party_id if country==16, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib1604.party_id if country==16, group(respid) or

* Lux
clogit cvote dis_lr ib3803.party_id if country==38, group(respid) or
clogit cvote dis_lr dis_imm dis_eu ib3803.party_id if country==38, group(respid) or


* To replicate Table 3 use data file named "simulations_results.dta":
clear all 
set more off
use "simulations_results.dta"
bysort group : sum move*
